<%@ page language="java" import="java.sql.*" import="javax.servlet.http.HttpSession" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%String refuri = null;
if(request.getHeader("Referer")==null){
	refuri = "/Bys-Website/Public/PublicMainPage.jsp";
	}else{
		refuri = request.getHeader("Referer");
	}
//if(request.getParameter("backuri")!=null){
	//refuri = request.getParameter("backuri");
//}
if(request.getParameter("param")!=null){
	refuri = request.getParameter("param");
}
	%>
	

<html>
<head>
	<meta http-equiv="content-type" content="text/html" />
	<meta name="author" content="blog.anchen8.net" />

	<title>毕业生，你的选择</title>
    <link rel="stylesheet" type="text/css" href="css/login.css" />
    <script type="text/javascript" src="js/school.js"></script>
    <script type="text/javascript" src="js/home.js"></script>
    <script type="text/javascript" src="/Bys-Website/js/jQuery1.82.js"></script>
    <script type="text/javascript">
	$(document).ready(function() {
		$(".aba").hide();
			$("#login").click(function() {
				$(".aba").hide();
				$.post("LoginServlet", {
					UserName : $("#user").val(),
					UserPassword : $("#pwd").val(),
					method : '0',
					refuri : $("#refuri").val()
				}, function(data) {
					if(data=="password error"){
						$(".aba").show();
						$(".aba").text(data);
					}else{
						location.replace(data);
					}
				});
			
			});
	});
</script>
</head>

<body>
    <div class="topbar">
        <div class="toplogo">
            <img src="/Bys-Website/SourceImageFile/toplogo.jpg"/>
        </div>
        <div class="navi">
            <ul class="naviul">
                <li><a href="/Bys-Website/Public/Video.jsp" class="outli">视频</a></li>
				<li><a href="/Bys-Website/Public/Photo.jsp" class="outli">相册</a></li>
				<li><a href="/Bys-Website/Public/Blog.jsp" class="outli">博客</a></li>
            </ul>
        </div>
        <div class="loginfo">
            <ul class="loginfoul">
                <% if(session.getAttribute("pid")==null){%>
                <li><a href="/Bys-Website/Log_in.jsp">登录</a></li>
                <li><a href="/Bys-Website/Regist.jsp">注册</a></li>
                <%}else{
					String userID = session.getAttribute("pid").toString();%>
					<li><a href="/Bys-Website/PersonMainPage.jsp?userID=<%= userID %>"><%=session.getAttribute("username") %></a></li>     
					<li><a href="LoginServlet?method=1">退出</a></li>
				<%}%> 
            </ul>
        </div>
    </div>
    <div class="logo">
        <img src="/Bys-Website/SourceImageFile/logo.jpg" width="222px" height="37px"/>
    </div>
    <div class="welcome">
        <span>欢迎加入毕业生</span>
    </div>
    <br/>
    
    <div class="login">
        <div class="logtext">
            <ul>
                <li>用户名</li>
                <li>密码</li>
            <ul>
        </div>
        <div class="log">
            <form  method="post">
                <ul>
                    <li><input id="user" type="text" name="UserName" class="upinput"/></li>
                    <li><input id="pwd" type="password" name="UserPassword" class="upinput"/></li>
                </ul>
                <div class="btn">
                	<input id="login" type="button" class="btn-submit" value="登录"/>
                	<input id="refuri" type="hidden" value="<%=refuri%>"/>
                	<label id="error" class="aba">aaaa</label>
                </div>
            </form>
        </div>
        <div class="misspw">
            <a href="Public/GetUri.jsp">?忘记密码</a>
        </div>
        <div class="pic">
            <img src="/Bys-Website/SourceImageFile/pic.jpg"/>
        </div>
    </div>
</body>
</html>